<% cat2_options = (@item.nil? or @item.cat1.nil?) ? {} : @item.cat1.children.map{ |x| [x.name, x.id] } -%>
<%#= error_messages_for(@item) %>
<% form_for @item, :html => { :id => "form" } do |f| -%>
  <%= f.error_messages -%>
  <div class="box">
    <table class="table border">
      <tr class="th">
        <td width="80" align="right"><strong>名称</strong></td>
        <td><%=raw f.text_field :name, :style => "width:400px;" %></td>
      </tr>
      <tr class="tr2">
        <td width="80" align="right"><strong>一级分类</strong></td>
        <td><%= f.collection_select :cat1_id, ItemCategory.cat1, :id, :name, { :include_blank => '一级分类' } %>&nbsp;&nbsp;二级分类 <%= f.select :cat2_id, cat2_options, :include_blank => '二级分类' %>
          <%= f.hidden_field :cat1_name %>
          <%= f.hidden_field :cat2_name %>
        </td>
      </tr>
      <tr>
        <td width="80" align="right"><strong>风格</strong></td>
        <td><%= f.collection_select :style_id, ItemStyle.valid, :id, :name %></td>
      </tr>
      <tr class="tr2">
        <td width="80" align="right"><strong>品牌</strong></td>
        <td><%= f.collection_select :brand_id, Brand.valid, :id, :name %></td>
      </tr>
      <tr>
        <td width="80" align="right"><strong>cloth_type</strong></td>
        <td><%= f.text_field :cloth_type %></td>
      </tr>
      <tr class="tr2">
        <td width="80" align="right"><strong>pic_design</strong></td>
        <td><%= f.text_field :pic_design %></td>
      </tr>
      <tr>
        <td width="80" align="right"><strong>season</strong></td>
        <td><%= f.text_field :season %></td>
      </tr>
      <tr class="tr2">
        <td align="right" valign="top"><strong>描述</strong></td>
        
        <td><%= f.text_area :description, :style => "width:392px; height: 100px;" %><%#= fckeditor_textarea("brand", "description", :toolbarSet => 'Easy', :width => '950px', :height => '500px') %></td>
      </tr>
      <tr>
        <td width="80" align="right"><strong>Meta 关键字</strong></td>
        <td><%= f.text_field :meta_keywords, :style => "width:400px;" %></td>
      </tr>
      <tr class="tr2">
        <td width="80" align="right"><strong>Meta 描述</strong></td>
        <td><%= f.text_field :meta_description, :style => "width:400px;" %></td>
      </tr>
    </table>
  </div>
<% end -%>

<%= javascript_include_tag 'base' -%>
